const Router = require('@koa/router');
const router = new Router()
const multer = require('@koa/multer')

router.post('/upload', async (ctx) => {
  const { file } = ctx.request.files;
  if (file) {
    ctx.body = { imgName: file.newFilename }
  } else {
      ctx.body = '上传出错'
  }
})

module.exports = router